import { instance } from '@/api/shared'
import type { Resp } from '@/api/shared/type'

export type DDoSFlow = {
  ip: string
  protocol: number
  flowDuration: number
  fwdPackets: number
  flowType: string
  time: string // ISO 时间字符串
}

export async function GetAllDDoSFlows(): Promise<Resp> {
  try {
    const res = await instance.get('/ddos/allflow')
    return res.data
  } catch (error) {
    console.error(error)
    throw error
  }
}
